<?php

namespace app\index\controller;

use think\Controller;
use think\Request;

class user extends Controller
{
  public function index(){
          $a= db('goods')->select();
          return view('index',['list'=>$a]);
  }
  public function type(){
          $c=$_REQUEST['id'];
      if ($c==1){
          $a=db('goods')->where('type_id',1)->select();
          return view('index',['list'=>$a]);
      }
      if ($c==2){
          $a=db('goods')->where('type_id',2)->select();
          return view('index',['list'=>$a]);
      }
      if ($c==3){
          $a=db('goods')->where('type_id',3)->select();
          return view('index',['list'=>$a]);
      }
  }
}
